package coml.jiyun.hp.wanandroid.model;

import coml.jiyun.hp.wanandroid.base.BaseModel;
import coml.jiyun.hp.wanandroid.bean.SquareBean;
import coml.jiyun.hp.wanandroid.net.HttpUtil;
import coml.jiyun.hp.wanandroid.net.ResultCallBack;
import coml.jiyun.hp.wanandroid.net.ResultSubscriber;
import coml.jiyun.hp.wanandroid.net.RxUtils;

public class SquareModel extends BaseModel {
    public void getSquare(final ResultCallBack<SquareBean>callBack){
        addDisposable(HttpUtil.getInstance()
        .getSquareServer()
        .getSquare()
        .compose(RxUtils.<SquareBean>rxSchedulerHelper())
        .subscribeWith(new ResultSubscriber<SquareBean>() {
            @Override
            public void onNext(SquareBean squareBean) {
                callBack.onSuccess(squareBean);
            }
        }));
    }
}